#pragma once
#include "afxcmn.h"


// CDlgPickUser dialog

class CDlgPickUser : public CDialog
{
	DECLARE_DYNAMIC(CDlgPickUser)

public:
	CDlgPickUser(CWnd* pParent = NULL);   // standard constructor
	virtual ~CDlgPickUser();
	virtual BOOL OnInitDialog();
	virtual void OnOK();
	virtual void OnCancel();

	afx_msg void OnNMDblclkListUsers(NMHDR *pNMHDR, LRESULT *pResult);
	afx_msg void OnLvnItemchangedListUsers(NMHDR *pNMHDR, LRESULT *pResult);
	afx_msg void OnLvnGetdispinfoListUsers(NMHDR *pNMHDR, LRESULT *pResult);
	afx_msg void OnHdnItemclickListUsers(NMHDR *pNMHDR, LRESULT *pResult);
	afx_msg void OnLvnOdfinditemListUsers(NMHDR *pNMHDR, LRESULT *pResult);
	afx_msg void OnBnClickedButtonFind();
	afx_msg void OnBnClickedButtonAddUser();

// Dialog Data
	enum { IDD = IDD_DIALOG_PICK_USER };
	enum PICK_USER_TYPE { PICK_TYPE_USER, PICK_TYPE_STAFF, PICK_TYPE_ILL };

protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support

	DECLARE_MESSAGE_MAP()

	void FillList();
	INT SetDefaultButton(const DWORD nNewId);

public:
	BOOL m_bAdd;

	struct PICKLIST
	{
		LONG nUserID;
		INT nActivated;
		CString szUserName;
		CString szUserEmail;
		CString szUserLANID;
		CString szUserCompany;
	};

	INT m_nType;
	CString m_szSort;
	CString m_szFilter;
	CArray<PICKLIST> m_aPickList;

	CListCtrl m_ctrlUsersList;
	CString m_szEmail;
	CString m_szName;
	CString m_szCompany;
	INT m_nCurrentSort;
	BOOL m_bSortAscending;
	CString m_szFind;
};
